package com.zengdada.authority.model;

import org.quartz.TriggerKey;

/**
 * @Auther: 12614
 * @Contact: 1261438511@qq.com
 * @Date: 2019-03-30 00:30
 * @Description:
 */
public class TimedTaskExtend extends TimedTask {


    public static final int STRATEGY_MULTITON = 0;
    public static final int STRATEGY_SINGLETON_WAIT = 1;
    public static final int STRATEGY_SINGLETON_SKIP = 2;
    private TriggerKey triggerKey = null;

    public TriggerKey getTriggerKey() {
        if (triggerKey == null) triggerKey = new TriggerKey(getId(), "GROUP-" + getTaskType());
        return triggerKey;
    }

    @Override
    public void setTaskType(String taskType) {
        super.setTaskType(taskType);
        triggerKey = new TriggerKey(getId(), "GROUP-" + getTaskType());
    }
}
